package com.hsbc.dev.teamo4.sms.sm.service.impl;

import com.hsbc.dev.teamo4.sms.sm.dao.IUserDao;
import com.hsbc.dev.teamo4.sms.sm.dao.impl.UserDaoImpl;
import com.hsbc.dev.teamo4.sms.sm.po.User;
import com.hsbc.dev.teamo4.sms.sm.service.IUserService;

import java.util.List;

/**
 * @author:Kevin
 * @version:
 * @Project: permission_manage
 * @Package: com.hsbc.dev.teamo4.sms.sm.service.impl
 * @Description:
 * @Date date: 2018/7/25
 */
public class UserServiceImpl implements IUserService {
    private IUserDao iUserDao=new UserDaoImpl();

    /**
     * save User
     * @param user
     * @return User
     */
    @Override
    public User save(User user) {
        return iUserDao.saveEntity(user);
    }

    /**
     * update User
     * @param user
     * @return User
     */
    @Override
    public User update(User user) {
        return iUserDao.updateEntity(user);
    }

    /**
     * query User By Id
     * @param id
     * @return User
     */
    @Override
    public User queryById(String id) {
        return iUserDao.queryById(id);
    }

    /**
     * query User List
     * @return List<User>
     */
    @Override
    public List<User> queryEntityList() {
        return iUserDao.queryAllEntity();
    }

    @Override
    public int updateByIsEnable(String id, Boolean bool) {
        return iUserDao.updateByIsEnable(id,bool);
    }

    /**
     * @Description 通过账户id获取用户信息
     * @Date: 21:02 2018-07-27
     * @Param accountId
     * @return com.hsbc.dev.teamo4.sms.sm.po.User
     */
    @Override
    public User queryByAccountId(String accountId){
        return iUserDao.queryByAccountId(accountId);
    }

    /**
     * @Description 通过用户名对用户信息进行模糊查询
     * @Date 10:12 2018-07-29
     * @param name
     * @return
     */
    @Override
    public List<User> querylikeName(String name) {
        return iUserDao.querylikeName(name);
    }
}
